package com.login;
import java.sql.SQLException;
import java.util.Scanner;

import com.impl.UserDao;



public class zhuce {
	public zhuce(){
		 System.out.println("┌────────────────────────┐");
		 System.out.println("│    知识管理系统.                               │");
		 System.out.println("├────────────────────────│");
		 System.out.println("│  账号     _________                            │");
		 System.out.println("├────────────────────────│");
		 System.out.println("│  密码     _________                            │");
		 System.out.println("├────────────────────────│");
		 System.out.println("│        [注册]                                  │");
		 System.out.println("└────────────────────────┘");
	}
	
	public void start() throws SQLException{
		user us1=new user();
		System.out.print("请输入账号：");
		Scanner sc1 = new Scanner(System.in);
		String name=sc1.next();
		us1.setName(name);
		System.out.print("请输入密码：");
		Scanner sc2 = new Scanner(System.in);
		String pwd=sc1.next();
		us1.setPwd(pwd);
		UserDao.insert(us1);
		sc1.close();sc2.close();
		System.out.println("注册成功！ ");
		new PageLogin().start();
	}
	
	

	}

